package com.boatAnchorAssistant.service.task;

import com.boatAnchorAssistant.service.service.in.AlarmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author anni.zhu
 * @author anni.zhu@king-v.com
 * Created in 2024/11/28 16:49
 * 定时任务-
 */

@Component
public class ScheduledTasks {

    @Autowired
    private AlarmService alarmService;

    /**
     * 清理时间，每天晚上12点
     * 清理15天之前的所有报警等级！=3的报警数据
     */
     @Scheduled(cron = "0 0 0 * * ?")
     @Transactional(rollbackFor = Exception.class)
    public void cleanAlarmLevel() {
             alarmService.cleanAlarmLevel();
        }
}
